package com.ffs.game.scene.obj;


import com.ffs.game.common.entity.Vector2f;
import com.ffs.game.scene.obj.ai.MonsterState;
import com.ffs.game.scene.obj.ai.fsm.AbstractFSMState;
import com.ffs.game.scene.obj.ai.fsm.FSMMachine;

/**
 * 怪物
 *
 * @author ffs80
 */
public class Monster extends MapObject {

    private FSMMachine<AbstractFSMState<MonsterState, Monster>> monsterMachine;

    /**
     * 怪物ai类型
     */
    private int aiType;

    /**
     * 怪物当前坐标
     */
    private Vector2f vector2f;

    /**
     * 巡逻点
     */
    private Vector2f nextVector2f;

    /**
     * 巡逻半径
     */
    private int patrolRadius;

    /**
     * 是否死亡
     */
    private boolean isDead;

    /**
     * 复活间隔
     */
    private int reviveInterval;


    public Monster(long id, int x, int y, int width, int height) {
        super(id, x, y, width, height);
        vector2f = new Vector2f(x, y);
    }

    @Override
    public void update(int delta) {

    }

    @Override
    public void initAnimation() {

    }

    /**
     * 怪物移动
     */
    public void move(Vector2f vector2f) {
        this.vector2f = vector2f;
        this.setX(vector2f.getX());
        this.setY(vector2f.getY());
    }

    public FSMMachine<AbstractFSMState<MonsterState, Monster>> getMonsterMachine() {
        return monsterMachine;
    }

    public void setMonsterMachine(FSMMachine<AbstractFSMState<MonsterState, Monster>> monsterMachine) {
        this.monsterMachine = monsterMachine;
    }

    public int getAiType() {
        return aiType;
    }

    public void setAiType(int aiType) {
        this.aiType = aiType;
    }

    public Vector2f getVector2f() {
        return vector2f;
    }

    public void setVector2f(Vector2f vector2f) {
        this.vector2f = vector2f;
    }

    public Vector2f getNextVector2f() {
        return nextVector2f;
    }

    public void setNextVector2f(Vector2f nextVector2f) {
        this.nextVector2f = nextVector2f;
    }

    public int getPatrolRadius() {
        return patrolRadius;
    }

    public void setPatrolRadius(int patrolRadius) {
        this.patrolRadius = patrolRadius;
    }

    public boolean isDead() {
        return isDead;
    }

    public void setDead(boolean dead) {
        isDead = dead;
    }

    public int getReviveInterval() {
        return reviveInterval;
    }

    public void setReviveInterval(int reviveInterval) {
        this.reviveInterval = reviveInterval;
    }

}
